package com.shop.controller;

import com.github.pagehelper.PageInfo;
import com.shop.entity.OrderMaster;
import com.shop.entity.Product;
import com.shop.entity.Result;
import com.shop.service.OrderMasterService;
import com.shop.service.ProductService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * description: 该文件说明
 *
 * @author zhaoxiaozhao（xiaozhao.zhao@ucarinc.com）
 * @version 1.0
 * @date 2018/10/12 17:01
 **/
@Controller
@RequestMapping("/orderMaster")
public class OrderMasterController {


    @Resource
    private OrderMasterService orderMasterService;

    /**
     * description:<商品管理的界面>
     *
     * @author zhaoxiaozhao（xiaozhao.zhao@ucarinc.com）
     * @date   2018/10/9 13:40
     * @param
     * @return
     **/
    @RequestMapping("/orderMasterList")
    public String orderMasterList(){
        return "orderMasterList";
    }

    /**
     * description:<商品管理查找>
     *
     * @param
     * @return
     * @author zhaoxiaozhao（xiaozhao.zhao@ucarinc.com）
     * @date 2018/10/9 13:40
     **/
    @RequestMapping("/getOrderMasterList")
    @ResponseBody
    public PageInfo<OrderMaster> getCategoryList(@RequestParam(value = "page", defaultValue = "1") Integer page, @RequestParam(value = "rows", defaultValue = "2") Integer rows, OrderMaster orderMaster) {
        PageInfo<OrderMaster> pageInfo =  orderMasterService.findOrderMaster(page,rows,orderMaster);
        return pageInfo;
    }

    /**
     * description:<修改订单状态>
     *
     * @param
     * @return
     * @author zhaoxiaozhao（xiaozhao.zhao@ucarinc.com）
     * @date 2018/10/9 13:40
     **/
    @RequestMapping("/updateOrderMasterStatu")
    @ResponseBody
    public Result updateOrderMasterStatu(OrderMaster orderMaster) {
        return orderMasterService.updateOrderMasterStatu(orderMaster);
    }

    /**
     * description:<修改订单配送状态>
     *
     * @param
     * @return
     * @author zhaoxiaozhao（xiaozhao.zhao@ucarinc.com）
     * @date 2018/10/9 13:40
     **/
    @RequestMapping("/updateSendStatu")
    @ResponseBody
    public Result updateSendStatu(OrderMaster orderMaster) {
        return orderMasterService.updateSendStatus(orderMaster);
    }


}
